<template>
    <div class="error-page">
        <h1>{{ error?.statusCode }}</h1>
        <div class="error-details">
            <h2>{{ error?.message }}</h2>
        </div>
        <button @click="handleError">返回登录页面</button>
    </div>
</template>

<script setup lang="ts">
definePageMeta({
    layout: 'login'
})
const props = defineProps({
    error: Object
})
console.log(props.error, 'error');

const handleError = () => {
    const token = useCookie('X-Auth-Token')
    token.value = null
    navigateTo('/login')
}
</script>

<style scoped>
.error-page {
    padding: 2rem;
    text-align: center;
}
</style>